export default {
    //用于能够被4个mapXxxxxx识别的命名空间
    namespaced,
    actions:{
        increase(context, value){
            context.commit('increase',value)
            console.log(this, '')
        },
        decrease(context, value){
            context.commit('decrease',value)
        },
    },
    mutations:{
        increase(state, value){
            state.sum += value
        },
        decrease(state, value){
            state.sum -= value
        },
        increaseOdd(state, value){
            state.sum += state.sum%2===1?value:0
        },
        increaseWait(state, value){
            setTimeout(()=>{
                state.sum += value
            },1000)
        },
    },
    state:{
        sum:0,
        school:'zzz',
        subject:'ppp',
    },
    getters : {
        bigSum(state){
            //这里的state是局部的state，不是总得state
            return state.sum*10
        },
    }
}